package com.supreme.studyserver.service;

import com.alibaba.fastjson.JSONObject;
import com.supreme.studyserver.annotation.SupremeAsync;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@SupremeAsync
@Service
public class AsyncTaskService {

    @Resource
    private JSONObject singletonScope;

    @Resource
    private JSONObject prototypeScope;

    @Resource
    private JSONObject requestScope;

    @Resource
    private JSONObject sessionScope;

    public void singletonScope() {
        System.out.println("AsyncTaskService singletonScope = " + singletonScope.toJSONString());
    }

    public void prototypeScope() {
        System.out.println("AsyncTaskService prototypeScope = " + prototypeScope.toJSONString());
    }

    public void requestScope() {
        System.out.println("AsyncTaskService requestScope = " + requestScope.toJSONString());
    }

    public void sessionScope() {
        System.out.println("AsyncTaskService sessionScope = " + sessionScope.toJSONString());
    }
}
